Release 10.1A: OpenEdge Getting Started:
Object-oriented Programming
Glossary of terms
Table 1–1 defines the terms used throughout this manual to define basic object-oriented concepts.
Table 1–1: Glossary of terms Term Meaning Abstraction An object's abstraction defines the essential characteristics of an object as visible from the outside. An object's abstraction separates its behavior from its implementation. You can think of the object's behavior as the services it provides to other objects, or the contract agreed to by the object. Class A class provides a definition of a type, which represents the structure of the instances of the class. The class defines the data members (representing the state) and methods (implementing the behavior) of an object belonging to this class. Class hierarchy A class hierarchy is the set of classes that make up the class definition. The hierarchy includes all classes in the inheritance chain as well as any implemented interfaces. Delegation Delegation allows one class (referred to as the container class) to access the public interface of another class (referred to as the delegate). Normally the container class uses the capabilities of the other class by delegating work to it. The container class may define its own public interface to allow other classes outside the container class to access the delegate class's capabilities. Encapsulation Encapsulation refers to the design and creation of self-contained and purposed components that are implemented as classes. Because a well-designed class strictly controls access to its state and behavior without revealing its implementation, it therefore supports information hiding (encapsulation) to protect that state and behavior. Thus, encapsulation allows the implementation of an object’s behavior to change without affecting any caller that invokes that behavior in the object. Inheritance Inheritance is the mechanism through which new classes (or types) can be derived from existing classes or types. The relationship of subclass and super class is established by inheritance. The subclass inherits thePUBLICandPROTECTEDdata members and methods from the super class. The subclass can then provide its own implementation of inherited methods (see Overriding) and also add additional data members and methods of its own. Inheritance can thus be viewed as a specialization mechanism.The hierarchy that is established when one class inherits from another treats the classes in the hierarchy as a single unit. From outside the class, you cannot tell whether the class's state and behavior are defined directly in the class or inherited from a super class. The class that you actually instantiate becomes the bottom of its class hierarchy in the running class instance. Interface An interface is a special type of class that specifies a contract of methods for behavior that must be implemented by any class that implements the interface. An interface assures a common set of behaviors and allows all objects with the interface to be treated in a common way. All methods in an interface are abstract, meaning that the interface provides only a method name and signature definition (prototype) for each method, but no implementation. Message To invoke specific behavior that is encapsulated by an instance of a class (object), you send a message to that object. To send a message to an object, you invoke a method on the object that is defined by its class or super class. Object An object is an instance of a class with state (represented by its data members) and behavior (implemented as methods). Object reference An object reference is a pointer (sometimes called a safe pointer) to an object. An object reference can be stored as a data member of a class or as a variable in a method, procedure, or user-defined function. Overriding A subclass can override a non-private method defined in its super class by providing a method with the same name and signature as that defined in its super class. An overriding method can access the overridden method in the super class in order to extend the super class behavior. Overriding a method is used to provide customized behavior in a subclass. Polymorphism A method can be implemented or overridden in different ways by different subclasses of a super class. Any reference to the method on the super class invokes the most derived version of the method, that is, the version of the method found in a subclass closest to the bottom of the class hierarchy. This ability to provide multiple behaviors for a method by allowing different implementations in different subclasses and, accessing the different subclass implementations through the super class, is called polymorphism. Root class The root class is a super class for all classes that do not explicitly inherit from some other class. In Progress, the root class is the built-in class,Progress.Lang.Object. For more information, see the "Using the root class — Progress.Lang.Object" section. Super class A super class is a class that is inherited by another class. A super class is also called a base class. The top-most super class in a given class hierarchy is the root class (Progress.Lang.Objectin the Progress 4GL). Subclass A subclass is a class that inherits behavior from another class (its super class). The subclass has access to all of the non-private state and behavior of its super class. A subclass is also called a derived class, and the bottom-most sublcass in a given class hierarchy is also called the most derived class. Type A type is used to depict the state and behavior of an object. Types are not concerned with implementation aspects of objects. Providing an implementation is the purpose of classes. Types specify the structure and semantics of values while classes specify the implementation aspects. Types are used to enforce strong typing.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |